package controllers;

import play.Play;
import play.libs.Crypto;
import models.User;

public class Security extends Secure.Security {

    static boolean authenticate(String username, String password) {
        password = Crypto.encryptAES(password);
        return User.connect(username, password) != null;

    }

    static void onAuthenticated() {
        Admin.index();
    }

    static void onDisconnected() {
        Application.index();
    }
}
